package com.katze.boot.common.converter;

import cn.idev.excel.converters.integer.IntegerStringConverter;
import cn.idev.excel.metadata.GlobalConfiguration;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.metadata.property.ExcelContentProperty;

public class SexConverter extends IntegerStringConverter {

    @Override
    public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        return switch (value) {
            case 0 -> new WriteCellData<>("男");
            case 1 -> new WriteCellData<>("女");
            default -> new WriteCellData<>("保密");
        };
    }
}
